package com.tgb.service;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tgb.dao.LeaveDao;
import com.tgb.entity.Leave;

/**
 * 请假实体管理
 *
 * @author hejingyuan@Component
 */
@Service
@Transactional(readOnly = true)
public class LeaveManager {
	//请假dao
	private LeaveDao leaveDao;

    public Leave getLeave(Long id) {
        return leaveDao.findOne(id);
    }

    @Transactional(readOnly = false)
    public void saveLeave(Leave entity) {
        
        leaveDao.save(entity);
    }

    @Autowired
    public void setLeaveDao(LeaveDao leaveDao) {
        this.leaveDao = leaveDao;
    }
	/**
	 * 根据申请的id查询申请信息
	 * @param id
	 * @return
	 */
    public Leave queryEntityById(Long id){
    	return leaveDao.findOne(id);
    }
}
